package T4.EjemplosDelSwing.ejemplosgui;

import javax.swing.*;
import java.awt.*;

class Frame6 extends JFrame {

    public Frame6() {
        setSize(600, 400);
        Container container = this.getContentPane();
        FlowLayout fl = new FlowLayout(FlowLayout.LEFT, 5, 10);
        container.setLayout(fl);
        for (int i = 0; i < 14; i++) {
            JButton button = new JButton("Button" + (i + 1));
            button.setPreferredSize(new Dimension(100 + (i % 5) * 20, 25 + (i % 4) * 20));
            container.add(button);
        }
    }
}

public class Ejemplo6 {

    public static void main(String[] args) {
        Frame6 frame = new Frame6();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
}
